FROM openjdk:8u342-slim

LABEL user="chris" mail="majewing@126.com" name="supreme-aspect-server" group="supreme-server"

EXPOSE 7220

ARG INPUT_DATE=current-date
RUN echo ${INPUT_DATE} > /home/build-date.log

ARG APP_NAME=supreme-aspect-server
ARG APP_VER=0.0.1
ARG APP_HOME=/home/${APP_NAME}
RUN mkdir -p ${APP_HOME}

VOLUME ["${APP_HOME}/logs"]

ARG JAR_FILE=${APP_NAME}-${APP_VER}.jar
ADD ${JAR_FILE} ${APP_HOME}/app-server.jar

ENV ASPECT_CONTROLLER="default controller"
ENV ASPECT_SERVICE="default service"
ENV TEMP_CONTENT="DockerfileContent"

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app-server.jar", "--spring.profiles.active=docker"]
CMD ["--logging.file.name=./logs/supreme-aspect-server.log", "--aspect-server.startCommand=docker-build-start-command", "--aspect-server.tempContent=${TEMP_CONTENT}"]